package com.cosmoplat.xikai.common.enums.business;


import lombok.Getter;

/**
 * @ClassName TaskStatusEnum
 * @Description 任务状态
 * @Author wdf
 * @Date 2025/1/7
 */
@Getter
public enum TaskPlanStatusEnum {
    /**
     * 0:未开始 1:进行中 2:已完成  3:暂停
     **/
    FLAG(-1, "空闲标志"),

    UN_START(0, "未开始"),

    DOING(1, "进行中"),

    FINISHED(2, "已完成"),

    PAUSE(3, "暂停"),

    RESTART(4, "再次开工");

    private Integer code;

    private String desc;

    TaskPlanStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String getNameByCode(Integer code) {
        for (TaskPlanStatusEnum taskStatusEnum : TaskPlanStatusEnum.values()) {
            if (taskStatusEnum.getCode().equals(code)) {
                return taskStatusEnum.getDesc();
            }
        }
        return null;
    }

}
